How to use implicit differentiation